using System;
using Microsoft.Win32;



namespace Stopwatch
{

    class RegistryOper
    {

        private const string STOPWATCH_KEY = (@"HKEY_LOCAL_MACHINE\Software\Motorola\Stopwatch");
        private const string KEY_MAX_SAVED_REPORTS = "MaxNumberSavedReports";
        private const string KEY_MAX_LAPS = "MaxNumberLaps";

        public int GetMaxNumberOfSavedReports()
        {

            try
            {
                int iMaxNumber = (int)Registry.GetValue(STOPWATCH_KEY, KEY_MAX_SAVED_REPORTS, Common.DEFAULT_MAX_NUMBER_SAVED_REPORTS);
               
                return iMaxNumber;
            }
            catch (Exception ex)
            {
                
                throw ex;
            }
        }


        public int GetMaxNumberOfLaps()
        {

            try
            {
                int iMaxLaps = (int)Registry.GetValue(STOPWATCH_KEY, KEY_MAX_LAPS, Common.DEFAULT_MAX_NUMBER_LAPS);

                return iMaxLaps;
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }

    }
}
